import {
  type IPanelItemProvider,
  PanelController,
  PanelItemController,
} from "@ibiz-template/runtime";
import type { IPanelItem } from "@ibiz/model-core";

/**
 * 用户信息适配器
 *
 * @export
 * @class AuthUserinfoProvider
 * @implements {IPanelItemProvider}
 */
export class AuthUserinfoProvider implements IPanelItemProvider {
  component: string = "IBizAuthUserinfo";

  async createController(
    panelItem: IPanelItem,
    panel: PanelController,
    parent: PanelItemController | undefined
  ): Promise<PanelItemController> {
    const c = new PanelItemController(panelItem, panel, parent);
    await c.init();
    return c;
  }
}
